package com.lightheart.sphr.xiaobinggan.navigation.ui
import android.content.Intent
import com.lightheart.sphr.xiaobinggan.R
import com.lightheart.sphr.xiaobinggan.base.BaseActivity
import com.lightheart.sphr.xiaobinggan.bottom.ui.BottomBarActivity
import com.lightheart.sphr.xiaobinggan.bottom.ui.EqualBottomBarActivity
import com.lightheart.sphr.xiaobinggan.bottom.ui.FloatingTopBarActivity
import com.lightheart.sphr.xiaobinggan.bottom.ui.TopBarActivity
import com.lightheart.sphr.xiaobinggan.module.home.presenter.HomePresenter
import kotlinx.android.synthetic.main.activity_readable_bottom_bar.*
import kotlinx.android.synthetic.main.common_toolbar.*
/***
 *https://github.com/gauravk95/bubble-navigation
 * */
class ReadableBottomBarActivity : BaseActivity<HomePresenter>() {

    override fun getLayoutId() = R.layout.activity_readable_bottom_bar

    override fun initInjector() {

    }

    override fun initView() {
        initToolbar(common_toolbar, common_toolbar_title_tv, bt_sub, R.string.navigation, false, R.string.register)

        open_top_navigation_bar.setOnClickListener {
            launchTopBarActivity()
        }

        open_top_float_navigation_bar.setOnClickListener {
            launchFloatingBarActivity()
        }

        open_bottom_equal_navigation_bar.setOnClickListener {
            launchEqualBarActivity()
        }

        open_bottom_navigation_bar.setOnClickListener {
            launchBottomBarActivity()
        }
    }

    private fun launchBottomBarActivity() {
        val intent = Intent(this, BottomBarActivity::class.java)
        startActivity(intent)
    }

    private fun launchTopBarActivity() {
        val intent = Intent(this, TopBarActivity::class.java)
        startActivity(intent)
    }

    private fun launchFloatingBarActivity() {
        val intent = Intent(this, FloatingTopBarActivity::class.java)
        startActivity(intent)
    }

    private fun launchEqualBarActivity() {
        val intent = Intent(this, EqualBottomBarActivity::class.java)
        startActivity(intent)
    }

    override fun showHomeAsUp(): Boolean {
        return true
    }

}